#include <buola/gui/containers/cmosaiccontainer.h>
#include <buola/image/cgc.h>
#include <buola/app/ceventloop.h>
#include <buola/widgets/cbutton.h>
#include <buola/widgets/ceditbox.h>

using namespace buola;

class CTestWindow : public gui::CMosaicContainer
{
public:
    CTestWindow()
    {
        SetTitle(L"mosaic example");
        
        for(int i=0;i<5;i++)
        {
            gui::PWindow lWindow=new gui::CWindow;
            lWindow->SetTitle(L"a window");
            Add(lWindow);
        }
    }
};

typedef intrusive_ptr<CTestWindow> PTestWindow;

int main(int pNArg,char **pArgs)
{
    buola_init(pNArg,pArgs);

    try
    {
        PTestWindow lWindow=new CTestWindow;
        lWindow->Map();

        get_main_event_loop().Loop();
    }
    catch(std::exception &pE)
    {
        msg_info() << "caught exception " << pE.what() << "\n";
    }

    return buola_finish();
}
